思古影视[V2].js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. var rule = {
  2. title: '思古影视[V2]', // csp_AppYsV2
  3. host: 'https://siguyy.cn/api.php/app/',
  4. // hostJs:'print(HOST);let html=request(HOST,{headers:{"User-Agent":PC_UA}});let src=jsp.pdfh(html,"ul&&li:eq(1)&&a&&href");print(src);HOST=src+"/api.php/app/"',
  5. url: 'video?tid=fyclassfyfilter&limit=20&pg=fypage',
  6. class_name: '电影&连续剧&综艺&动漫',
  7. class_url: '1&2&3&4',
  8. filter_url: '&class={{fl.class}}&area={{fl.area}}&lang={{fl.lang}}&letter={{fl.letter}}&year={{fl.year}}&by={{fl.by}}',
  9. filter: 'H4sIAAAAAAAAA+2Z3W4aRxSA34VrX3hx4qR5lSoXqEK9qOuLRK0URZZsYwgQx2DLwaHgv8YY4hoMtuvCUuBldnaXt+iwZ84PVb1dtVbUVHvHd87O7PmZOWd2eJ2wEs++fp34Lv0q8SzxzUrq5cvEQmI19X1aoyo03UxW84+plR/SwXOrM3G2Nc20ZmINibUFI63U9fNGagB1Xr5nJmJAnbtRdtcrRmeA5iy2nFEd5wSgOZu7ajDEOQFoHBnOQO/Lf3DsAr4PAHV++1xtXxidAXpf8coboc6AsNPbH7KdMyBd4w3baYBsaZ874xO0BYDG5fam1U84DoDGHV1oy3EcQJR4upuXXmUXdQCkyxTdzZ9QB0C+D0sq20ffAVA3PdxzPzSMzgDNWXnjF2ycE4D8G3e8/V/VqIcuEtMTpTP/I2URgHQ7OVW6Rh0A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detailUrl: '/detail?vod_id=fyid',
  11. searchUrl: '/search?text=**&pg=fypage',
  12. searchable: 2,
  13. quickSearch: 0,
  14. filterable: 1,//是否启用分类筛选,
  15. // headers:{'User-Agent':'Dart/2.14 (dart:io)'},
  16. headers: {'User-Agent': 'okhttp/4.1.0'},
  17. timeout: 5000,
  18. // 分类筛选 /api.php/app/nav || /xgapp.php/v1/nav || /api.php/v1.vod/types
  19. // class_name:'电影&电视剧&动漫&综艺',
  20. // class_url:'20&21&22&23',
  21. play_parse: true,
  22. lazy: `js:
  23. let play_Url = '';
  24. if (/\\.m3u8|\\.mp4/.test(input)) {
  25. input = {
  26. jx: 0,
  27. url: input,
  28. parse: 0
  29. }
  30. } else if (/,/.test(input) && /url=/.test(input)) {
  31. input = input.split('url=');
  32. play_Url = input[0].split(',')[0];
  33. input = {
  34. jx: 0,
  35. url: input[1],
  36. playUrl: play_Url,
  37. parse: 1
  38. }
  39. } else if (/url=|id=/.test(input)) {
  40. input = {
  41. jx: 0,
  42. url: JSON.parse(request(input)).url,
  43. parse: 0
  44. }
  45. } else if (/youku|iqiyi|v\\.qq\\.com|pptv|sohu|le\\.com|1905\\.com|mgtv|bilibili|ixigua/.test(input)) {
  46. play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'https://jx.777jiexi.com/player/?url='; // type0的parse
  47. // play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'json:http://pandown.pro/app/kkdy.php?url='; // type1的parse可加'json:'直接解析url (除了蜂蜜的'影视TV',其它的壳皆可用)
  48. input = {
  49. jx: 0,
  50. url: input,
  51. playUrl: play_Url,
  52. parse: 1,
  53. header: JSON.stringify({
  54. 'user-agent': 'Mozilla/5.0',
  55. }),
  56. }
  57. } else {
  58. input
  59. }
  60. `,
  61. limit: 6,
  62. // 图片来源:'@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  63. 推荐: `js:
  64. let d = [];
  65. let jsondata = [];
  66. let videoList = [];
  67. if (/v1\\.vod/.test(HOST)) {
  68. if(HOST.endsWith('/')){
  69. jsondata = JSON.parse(request(HOST + 'vodPhbAll'));
  70. } else {
  71. jsondata = JSON.parse(request(HOST + '/vodPhbAll'));
  72. }
  73. videoList = jsondata.data.list[0].vod_list;
  74. } else {
  75. if(HOST.endsWith('/')){
  76. jsondata = JSON.parse(request(HOST + 'index_video'));
  77. } else {
  78. jsondata = JSON.parse(request(HOST + '/index_video'));
  79. }
  80. videoList = /xgapp/.test(HOST)?jsondata.data[0].vlist:jsondata.list[0].vlist;
  81. }
  82. // log('videoList =========> '+stringify(videoList));
  83. videoList.forEach(it => {
  84. d.push({
  85. url:it.vod_id,
  86. title:it.vod_name,
  87. img:it.vod_pic.startsWith('https') ? it.vod_pic : it.vod_pic.startsWith('http') ? it.vod_pic.replace('http','https') : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  88. desc:it.vod_remarks,
  89. });
  90. });
  91. setResult(d);
  92. `,
  93. 一级: `js:
  94. let d = [];
  95. let jsondata = [];
  96. let videoList = [];
  97. if (/v1\\.vod/.test(HOST)) {
  98. input = input.replace('video','v1.vod').replace('tid','type').replace('pg=','page=');
  99. jsondata = JSON.parse(request(input));
  100. videoList = jsondata.data.list;
  101. } else {
  102. input = HOST + '/'+ input.split('/')[4];
  103. jsondata = JSON.parse(request(input));
  104. videoList = jsondata.list || jsondata.data;
  105. }
  106. // log('videoList =========> '+stringify(videoList));
  107. videoList.forEach(it => {
  108. d.push({
  109. url:it.vod_id,
  110. title:it.vod_name,
  111. img:it.vod_pic.startsWith('https') ? it.vod_pic : it.vod_pic.startsWith('http') ? it.vod_pic.replace('http','https') : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  112. desc:it.vod_remarks,
  113. });
  114. });
  115. setResult(d);
  116. `,
  117. 二级: `js:
  118. if (/v1\\.vod/.test(HOST)) {
  119. input = HOST + '/'+ input.split('/')[3];
  120. } else {
  121. input = HOST + '/'+ input.split('/')[3].replace('detail','video_detail').replace('vod_id','id');
  122. }
  123. try {
  124. let html = request(input);
  125. html = JSON.parse(html);
  126. let node = /xgapp/.test(HOST) ? html.data.vod_info : html.data;
  127. VOD = {
  128. vod_id: node.vod_id,
  129. vod_name: node.vod_name,
  130. vod_pic: node.vod_pic,
  131. type_name: node.vod_class,
  132. vod_year: node.vod_year,
  133. vod_area: node.vod_area,
  134. vod_remarks: node.vod_remarks,
  135. vod_actor: node.vod_actor,
  136. vod_director: node.vod_director,
  137. vod_content: node.vod_content.strip()
  138. };
  139. if (typeof play_url === 'undefined') {
  140. var play_url = ''
  141. }
  142. var name = {
  143. 'bfzym3u8': '暴风',
  144. '1080zyk': '优质',
  145. 'kuaikan': '快看',
  146. 'lzm3u8': '量子',
  147. 'ffm3u8': '非凡',
  148. 'haiwaikan': '海外看',
  149. 'gsm3u8': '光速',
  150. 'zuidam3u8': '最大',
  151. 'bjm3u8': '八戒',
  152. 'snm3u8': '索尼',
  153. 'wolong': '卧龙',
  154. 'xlm3u8': '新浪',
  155. 'yhm3u8': '樱花',
  156. 'tkm3u8': '天空',
  157. 'jsm3u8': '极速',
  158. 'wjm3u8': '无尽',
  159. 'sdm3u8': '闪电',
  160. 'kcm3u8': '快车',
  161. 'jinyingm3u8': '金鹰',
  162. 'fsm3u8': '飞速',
  163. 'tpm3u8': '淘片',
  164. 'lem3u8': '鱼乐',
  165. 'dbm3u8': '百度',
  166. 'tomm3u8': '番茄',
  167. 'ukm3u8': 'U酷',
  168. 'ikm3u8': '爱坤',
  169. 'hnzym3u8': '红牛资源',
  170. 'hnm3u8': '红牛',
  171. '68zy_m3u8': '68',
  172. 'kdm3u8': '酷点',
  173. 'bdxm3u8': '北斗星',
  174. 'qhm3u8': '奇虎',
  175. 'hhm3u8': '豪华',
  176. 'kbm3u8': '快播'
  177. };
  178. let episodes = /v1\\.vod/.test(HOST)?node.vod_play_list:node.vod_url_with_player;
  179. if (episodes != '') {
  180. let playMap = {};
  181. let arr = [];
  182. episodes.forEach(ep => {
  183. let from = [];
  184. if (/v1\\.vod/.test(HOST)) {
  185. from = ep.player_info.from||ep.player_info.show||ep.from||ep.show;
  186. } else {
  187. from = ep.code||ep.name;
  188. }
  189. if (!playMap.hasOwnProperty(from)) {
  190. playMap[from] = []
  191. }
  192. let parse_api = '';
  193. if (/v1\\.vod/.test(HOST)) {
  194. parse_api = ep.player_info.parse != null ? ep.player_info.parse : ep.player_info.parse2;
  195. // parse_api = /,/.test(parse_api) ? parse_api.split(',')[1] : parse_api;
  196. } else {
  197. parse_api = ep.parse_api;
  198. }
  199. log('parse_api =========> '+parse_api);
  200. if (parse_api != null && !/\\.m3u8|\\.mp4/.test(ep.url)) {
  201. parse_api = parse_api.replaceAll('..','.') ;
  202. ep.url = ep.url.replaceAll('$','$'+parse_api);
  203. }
  204. if (from != null) playMap[from].push(ep.url)
  205. });
  206. for (var key in playMap) {
  207. if ('bfzym3u8' == key) {
  208. arr.push({
  209. flag: name[key],
  210. url: playMap[key],
  211. sort: 1
  212. })
  213. } else if ('1080zyk' == key) {
  214. arr.push({
  215. flag: name[key],
  216. url: playMap[key],
  217. sort: 2
  218. })
  219. } else if ('kuaikan' == key) {
  220. arr.push({
  221. flag: name[key],
  222. url: playMap[key],
  223. sort: 3
  224. })
  225. } else if ('lzm3u8' == key) {
  226. arr.push({
  227. flag: name[key],
  228. url: playMap[key],
  229. sort: 4
  230. })
  231. } else if ('ffm3u8' == key) {
  232. arr.push({
  233. flag: name[key],
  234. url: playMap[key],
  235. sort: 5
  236. })
  237. } else if ('snm3u8' == key) {
  238. arr.push({
  239. flag: name[key],
  240. url: playMap[key],
  241. sort: 6
  242. })
  243. } else if ('qhm3u8' == key) {
  244. arr.push({
  245. flag: name[key],
  246. url: playMap[key],
  247. sort: 7
  248. })
  249. } else {
  250. arr.push({
  251. flag: name[key] ? name[key] : key,
  252. url: playMap[key],
  253. sort: 8
  254. })
  255. }
  256. }
  257. arr.sort((a, b) => a.sort - b.sort);
  258. let playFrom = [];
  259. let playList = [];
  260. arr.map(val => {
  261. if (!/undefined/.test(val.flag)) {
  262. playFrom.push(val.flag);
  263. playList.push(val.url);
  264. }
  265. })
  266. VOD.vod_play_from = playFrom.join('$$$');
  267. VOD.vod_play_url = playList.join('$$$');
  268. } else {
  269. VOD.vod_play_from = node.vod_play_from;
  270. VOD.vod_play_url = node.vod_play_url;
  271. }
  272. } catch (e) {
  273. log("获取二级详情页发生错误:" + e.message);
  274. }
  275. `,
  276. 搜索: `js:
  277. let d = [];
  278. let jsondata = [];
  279. let videoList = [];
  280. if (/v1\\.vod/.test(HOST)) {
  281. input = (HOST + '/'+ input.split('/')[3]).replace('/search','').replace('text=','wd=').replace('pg=','page=');
  282. jsondata = JSON.parse(request(input));
  283. videoList = jsondata.data.list;
  284. } else {
  285. input = HOST + '/'+ input.split('/')[3]
  286. jsondata = JSON.parse(request(input));
  287. videoList = jsondata.list || jsondata.data;
  288. }
  289. // log('videoList =========> '+stringify(videoList));
  290. videoList.forEach(it => {
  291. d.push({
  292. url:it.vod_id,
  293. title:it.vod_name,
  294. img:it.vod_pic.startsWith('https') ? it.vod_pic : it.vod_pic.startsWith('http') ? it.vod_pic.replace('http','https') : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  295. desc:it.vod_remarks,
  296. });
  297. });
  298. setResult(d);
  299. `,
  300. }